﻿using System.Xml;
using Blackbird.Common.Properties;
using Blackbird.Core.Editable.Base;
using Blackbird.Core.Editable.Frames;

namespace Blackbird.Core.Editable.Map
{
    public class EditableMultiframeMapNode : BaseEditableMapNode
    {

        public override System.Windows.Media.ImageSource ImageSource {
            get { return Frameset[0].BitmapSource; }
        }

        public EditableFrameset Frameset { get; set; }

        public override string TypeName
        {
            get { return Resources.EditableMultiframeMapNodeTypeFiendlyName; }
        }

        protected override void ReadXmlAttributes(XmlReader reader)
        {
        }

        protected override void ReadXmlContent(XmlReader reader)
        {
            reader.ReadStartElement("frameset");
            Frameset.ReadXml(reader);
            reader.ReadEndElement();
        }

        protected override void WriteXmlAttributes(XmlWriter writer)
        {
        }

        protected override void WriteXmlContent(XmlWriter writer)
        {
            writer.WriteStartElement("frameset");
            Frameset.WriteXml(writer);
            writer.WriteEndElement();
        }
    }
}